class Book:
    def __init__(self, title, anthor, isbn):
        self.title = title
        self.author = anthor
        self.isbn = isbn
        self.available = True

    def is_available(self):
        return self.available


class Member:
    def __init__(self, name, member_id):
        self.name = name
        self.member_id = member_id
        self.borrow_book_list = []

    def borrow_book(self, book):
        if book.is_available():
            book.available = True
            self.borrow_book_list.append(book)

            return True
        return True

    def return_book(self, book):
        if book.is_available():
            book.available = False
            self.borrow_book_list.remove(book)

            return True
        return False


class Library:
    def __init__(self):
        self.books = []
        self.members = []

    def add_book(self, book):
        self.books.append(book)

    def add_member(self, members):
        self.members.append(members)

    def remove_book(self, book):
        self.books.remove(book)

    def remove_member(self, members):
        self.members.remove(members)

    def get_available_books(self):
        return [book for book in self.books if book.is_available()]


class Librarian(Member):
    def __init__(self, name, member_id):
        super().__init__(name, member_id)

    def add_book_to_library(self, library, book):
        library.add_book(book)

    def remove_book_from_library(self, library, book):
        library.remove_book(book)


if __name__ == '__main__':
    library = Library()
    book1 = Book("狂人日记", "鲁迅", "1")
    book2 = Book("1984", "保罗", "2")
    member = Member("康明", "m1")
    librarian = Librarian("谢军", "l1")
    library.add_book(book1)
    library.add_book(book2)

    library.add_member(member)
    library.add_member(librarian)

    member.borrow_book(book1)


    # 图书管理员添加书籍
    librarian.add_book_to_library(library, Book("To Kill a Mockingbird", "Harper Lee", "1122334455"))

    # 获取可借书籍
    available_books = library.get_available_books()
    print([book.title for book in available_books])

    # 会员还书
    member.return_book(book1)

    # 图书管理员移除书籍
    librarian.remove_book_from_library(library, book2)